﻿<UserControl x:Class="SilveR.Views.StatsViews.GraphicalAnalysis"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"

    mc:Ignorable="d"
    d:DesignHeight="540" d:DesignWidth="580">
    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid>
            <Border Margin="3,3,3,3" Style="{StaticResource MainAnalysisBorderStyle}" >
                <Grid>
                    <TextBlock Text="Input" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}" />

                    <TextBlock Text="Select dataset" Margin="3,25,6,6"  Style="{StaticResource TextBlockStyle}" />
                    <ComboBox Name="cboData" Margin="95,21,6,6" ItemsSource="{Binding AvailableDataHandlers}" SelectedItem="{Binding SelectedDataHandler, Mode=TwoWay}" DisplayMemberPath="DisplayFileName" SelectionChanged="cboData_SelectionChanged"  Style="{StaticResource ComboBoxStyle}"/>

                    <TextBlock Text="Available variables" Margin="3,51,6,6" Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Height="170" Margin="3,73,6,6" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}" >
                        <ListBox Name="lstAvailableVariables" DisplayMemberPath="ColumnName" ItemsSource="{Binding AvailableVariables, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Response" Margin="141,51,6,6" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="141,73,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstResponse" DisplayMemberPath="ColumnName" ItemsSource="{Binding ResponseList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Transformation" Margin="141,100,6,6" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Name="cboResponseTransformations" Margin="141,117,6,6" ItemsSource="{Binding TransformationList}" SelectedItem="{Binding ResponseTransformation, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}" IsEnabled="False"/>

                    <TextBlock Text="X-axis variable" Margin="141,147,6,6" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="141,164,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstXAxis" DisplayMemberPath="ColumnName" ItemsSource="{Binding XAxisList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Transformation" Margin="141,194,6,6" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Name="cboXAxisTransformations" Margin="141,214,6,6" ItemsSource="{Binding TransformationList}" SelectedItem="{Binding XAxisTransformation, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}" IsEnabled="False"/>

                    <TextBlock Text="1st categorisation factor" Margin="276,51,6,6" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="276,73,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstFirstCatFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding FirstCatFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="2nd categorisation factor" Margin="276,101,6,6" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="276,118,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="SecondCatFactor" DisplayMemberPath="ColumnName" ItemsSource="{Binding SecondCatFactorList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}" />
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Categorised graph style" Margin="276,147,6,6" Style="{StaticResource TextBlockStyle}" />
                    <RadioButton Content="Overlaid" Margin="276,164,0,0" Name="rdoOverlaid" IsChecked="{Binding OverlaidSelected, Mode=TwoWay}" Style="{StaticResource RadioButtonStyle}" />
                    <RadioButton Content="Separate" Margin="357,164,0,0" Name="rdoSeparate" IsChecked="{Binding SeparateSelected, Mode=TwoWay}" Style="{StaticResource RadioButtonStyle}" />
                    <CheckBox Content="Display legend" Margin="276,187,0,0" Name="cbxLegend" IsChecked="{Binding DisplayLegend, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}"/>

                    <TextBlock Margin="3,250,0,0" Text="Main graph title" Style="{StaticResource TextBlockStyle}"/>
                    <TextBlock Margin="180,250,0,0" Text="X-axis title" Style="{StaticResource TextBlockStyle}"/>
                    <TextBlock Margin="310,250,0,0" Text="Y-axis title" Style="{StaticResource TextBlockStyle}"/>
                    <TextBox Margin="3,267,0,0" Name="txtMainTitle" Text="{Binding MainTitle}" Width="160" Style="{StaticResource TextBoxStyle}"/>
                    <TextBox Margin="180,267,0,0" Name="txtXAxis" Text="{Binding XAxisTitle}" Style="{StaticResource TextBoxStyle}"/>
                    <TextBox Margin="310,267,0,0" Name="txtYAxis" Text="{Binding YAxisTitle}" Style="{StaticResource TextBoxStyle}"/>
                </Grid>
            </Border>
            <Border Margin="3,310,0,0" Style="{StaticResource MainAnalysisBorderStyle}" >
                <Grid>
                    <TextBlock Text="Plot Types" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}" />
                    <Border Margin="3,22,3,3" Style="{StaticResource MinorAnalysisBorderStyle}" >
                        <Grid>
                            <TextBlock Text="Scatterplot" Margin="6,3,6,6" Style="{StaticResource TextBlockStyle}" />
                            <CheckBox Content="Scatterplot" Margin="6,22,6,6" Name="cbxScatterPlot" IsChecked="{Binding ScatterplotSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}"/>
                            <CheckBox Content="Linear fit" Margin="16,42,6,6" Name="cbxLinearFit" IsChecked="{Binding LinearFitSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}" IsEnabled="{Binding ScatterplotSelected}" />
                            <CheckBox Content="Correlation and p-value" Margin="16,64,6,6" Name="cbxCorrelationPValue" IsChecked="{Binding CorrelationPValueSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}" IsEnabled="{Binding ScatterplotSelected}" />
                        </Grid>
                    </Border>
                    <Border Margin="3,122,3,3" Style="{StaticResource MinorAnalysisBorderStyle}" Width="183" >
                        <Grid>
                            <TextBlock Text="Boxplot" Margin="6,3,6,6" Style="{StaticResource TextBlockStyle}" />
                            <CheckBox Content="Boxplot" Margin="6,22,6,6" Name="cbxBoxplot" IsChecked="{Binding BoxplotSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}"/>
                            <CheckBox Content="Outliers" Margin="16,42,6,6" Name="cbxOutliers" IsChecked="{Binding OutliersSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}" IsEnabled="{Binding BoxplotSelected}" />
                        </Grid>
                    </Border>
                    <Border Margin="190,22,3,3" Style="{StaticResource MinorAnalysisBorderStyle}" Width="135">
                        <Grid>
                            <TextBlock Text="SEM" Margin="6,3,6,6" Style="{StaticResource TextBlockStyle}" />
                            <CheckBox Content="SEM plot" Margin="6,22,6,6" Name="cbxSEM" IsChecked="{Binding SEMPlotSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}"/>
                            <RadioButton Content="Column plot" Margin="16,42,6,6" Name="rdoColumnPlot" IsChecked="{Binding ColumnPlotSelected, Mode=TwoWay}" Style="{StaticResource RadioButtonStyle}" IsEnabled="{Binding SEMPlotSelected}" />
                            <RadioButton Content="Line plot" Margin="16,64,6,6" Name="rdoLinePlot" IsChecked="{Binding LinePlotSelected, Mode=TwoWay}" Style="{StaticResource RadioButtonStyle}" IsEnabled="{Binding SEMPlotSelected}" />
                        </Grid>
                    </Border>
                    <Border Margin="190,122,3,3" Style="{StaticResource MinorAnalysisBorderStyle}">
                        <Grid>
                            <TextBlock Text="Histogram" Margin="6,3,6,6" Style="{StaticResource TextBlockStyle}" />
                            <CheckBox Content="Histogram plot" Margin="6,22,6,6" Name="cbxHistogram" IsChecked="{Binding HistogramSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}"/>
                            <CheckBox Content="Normal dist. fit" Margin="16,42,6,6" Name="cbxNormalDistFit" IsChecked="{Binding NormalDistSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}" IsEnabled="{Binding HistogramSelected}" />
                        </Grid>
                    </Border>
                    <Border Margin="330,22,3,3" Style="{StaticResource MinorAnalysisBorderStyle}" Height="175" >
                        <Grid>
                            <TextBlock Text="Case profiles" Margin="6,3,3,3" Style="{StaticResource TextBlockStyle}" />
                            <CheckBox Content="Case profiles plot" Margin="6,22,3,3" Name="cbxCaseProfilesPlot" IsChecked="{Binding CaseProfilesPlotSelected, Mode=TwoWay}" Style="{StaticResource CheckBoxStyle}"/>
                            <TextBlock Text="Case ID factor" Margin="6,45,3,3" Style="{StaticResource TextBlockStyle}" />
                            <ComboBox Name="cboCaseIDfactor" Margin="6,64,0,0" ItemsSource="{Binding AvailableVariables}" SelectedItem="{Binding CaseIDFactor, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}" IsEnabled="{Binding CaseProfilesPlotSelected}"/>
                            <TextBlock Text="Reference line" Margin="6,95,3,3" Style="{StaticResource TextBlockStyle}" />
                            <TextBlock Text="y=" Margin="6,118,3,3" Style="{StaticResource TextBlockStyle}" />
                            <TextBox Margin="26,115,0,0" Name="txtRefLine" Text="{Binding ReferenceLine}" Width="100" Style="{StaticResource TextBoxStyle}" IsEnabled="{Binding CaseProfilesPlotSelected}" />
                        </Grid>
                    </Border>
                </Grid>
            </Border>
        </Grid>
    </ScrollViewer>
</UserControl>
